/***************************************************************************************************/
/* @date on 2021/01/11                                                                             */
/* @author Xie Jian                                                                                */
/* @email 190954950@qq.com                                                                         */
/* @describe http请求                                                                              */
/***************************************************************************************************/
use crate::jtool::log;

pub fn request_url(url: &str) -> String{
    let m  = request_url2(url);
    return m;
}

fn request_url2(url: &str) -> String {
    let mut back_string = String::new();
    match reqwest::blocking::get(url) {
        Ok(response) =>{
            match response.text() {
                Ok(text) => {
                    //println!("Read response text {},{}", text.len(), text);
                    back_string =text;
                }
                Err(_) => {
                    println!("Read response text Error!")
                }
            };
        }
        Err(_)=>{
            println!("reqwest get Error!");
        }
    }   
    return back_string;
}
